-
Notifications
You must be signed in to change notification settings - Fork 2
Feat: Add macos installer #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added macOS distribution script to package.json. - Updated prisma.config.ts to use environment variable for database URL. - Modified paths.ts for cross-platform compatibility in resource paths. - Added template database file for initialization. - Included new application icon for macOS.
- Added afterEach hook to restore original process.resourcesPath. - Mocked process.resourcesPath for packaged mode tests to ensure accurate path resolution. - Updated assertions to check for 'app.asar.unpacked' in path results.
altaskur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds macOS packaging support and improves cross-platform runtime path resolution for the Electron app, alongside packaging, Prisma config, and documentation updates.
Changes:
- Switch Electron packaged asset resolution to
process.resourcesPath, and move the template DB toapp.asar.unpacked. - Add
dist:macand electron-builder macOS/DMG configuration; include/unpackprisma/template.dbin packaged builds. - Update Prisma config defaults and adjust docs/scripts around installation and DB template generation.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update-db-template.mjs | Updates template regeneration to use prisma db push --force-reset instead of migration reset. |
| prisma/template.db | Adds a generated SQLite template database used for initializing new DBs. |
| prisma.config.ts | Sets datasource URL from environment with a default SQLite file path; removes deprecated config. |
| package.json | Adds macOS build script and electron-builder mac/DMG config; ensures template DB is packaged and unpacked. |
| electron/src/utils/paths.ts | Uses process.resourcesPath for packaged asset paths; points template DB to app.asar.unpacked. |
| electron/src/utils/paths.spec.ts | Updates tests to mock/restore process.resourcesPath and validate new template DB location. |
| README.md | Updates installation instructions and scripts table (including macOS DMG). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request improves cross-platform compatibility, especially for macOS, and updates documentation and packaging for the project. The main changes include updating file path handling to use
process.resourcesPath, adding macOS build and packaging support, and enhancing the README with clearer installation instructions.Cross-platform path handling and packaging:
getIndexPath,getPreloadPath, andgetTemplateDatabasePathinelectron/src/utils/paths.tsto useprocess.resourcesPathfor better cross-platform compatibility (Windows/macOS/Linux), and adjusted template DB path to useapp.asar.unpackedin production. [1] [2] [3]electron/src/utils/paths.spec.tsto mock and restoreprocess.resourcesPath, ensuring test reliability across platforms. [1] [2]package.jsonto add macOS (dist:mac), specify macOS build targets, icons, and DMG settings, and ensureprisma/template.dbis included in packaged builds. [1] [2] [3]Documentation and developer experience:
README.mdto provide a clear download table for all platforms and updated the Prisma version badge. [1] [2]Prisma/database configuration:
prisma.config.tsto set the database URL from the environment or default path, and removed the deprecatedearlyAccessflag.prisma db push --force-resetinstead of migrations, ensuring the template is always up-to-date with the schema.DISCLAIMER: It would be good to review the build in Windows before merging to check that everything works as expected.